package com.athbsd.exer2;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class CollectionIterator {
    public static void main(String[] args) {
        Collection col = new ArrayList();
        col.add(new Book("三", "罗", "1"));
        col.add(new Book("小", "金", "2"));
        col.add(new Book("红楼梦", "曹雪芹", "3"));
        col.add("jack");
        //增强for循环
        for (Object o : col) {
            System.out.println("book"+o);
        }
    }
}
